package com.jdkreader.concurrency.concurrent.semaphore;

/**
 * 创建代价高昂的对象
 */
public class Fat {

    private double d;
    private static int counter = 0;
    private final int id = counter++;
    public Fat(){
        //重复进行10000次负责计算
        for(int i=0;i<10000;i++){
            d = (Math.PI + Math.E)/(double)i;
        }
    }
    public void operation(){
        System.out.println(this);
    }

    public String toString(){
        return "Fat id: " +id;
    }
}
